package com.example.zuoye.dao;

import com.example.zuoye.entity.Good;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodDAO {
    /**
     * 根据good_name 和 good_introduce 查找商品信息
     * @param good_name
     * @param good_introduce
     * @return
     */
    Good selectGoodInfoByNameAndIntroduce(@Param("good_name") String good_name,
                                       @Param("good_introduce") String good_introduce);

    /**
     * 根据good_name 查找商品信息
     * @param good_name
     * @return
     */
    Good selectGoodInfoByName(@Param("good_name") String good_name);

    /**
     * 根据good_id 删除商品信息
     * @param good_id
     * @return
     */
    int deleteGoodInfoById(@Param("good_id") Integer good_id);

    /**
     * 查找所有商品信息
     * @return
     */
    List<Good> selectGoodInfo();

    /**
     * 插入商品信息
     * @param good_name
     * @param good_introduce
     * @param good_price
     * @param good_date
     * @param good_number
     * @param good_image
     * @return
     */
    int insertGoodInfo(@Param("good_name") String good_name,
                       @Param("good_introduce")String good_introduce,
                       @Param("good_price")String good_price,
                       @Param("good_date")String good_date,
                       @Param("good_number")Integer good_number,
                       @Param("good_image")String good_image);

    /**
     * 根据good_name 和 good_introduce 删除商品信息
     * @param good_name
     * @param good_introduce
     * @return
     */
    int deleteGoodInfoByNameAndIntroduce(@Param("good_name") String good_name,
                                      @Param("good_introduce") String good_introduce);

    /**
     * 根据good_id,更新商品信息
     * @param good_id
     * @param good_name
     * @param good_introduce
     * @param good_price
     * @param good_date
     * @param good_number
     * @param good_image
     * @return
     */
    int updateGoodInfoById(@Param("good_id") Integer good_id,
                           @Param("good_name") String good_name,
                           @Param("good_introduce")String good_introduce,
                           @Param("good_price")String good_price,
                           @Param("good_date")String good_date,
                           @Param("good_number")Integer good_number,
                           @Param("good_image")String good_image);
}
